Simplifying Hugging Face Spaces API calls in Flutter using hugging_face_chat_gradio package

When I first started using the Hugging Face Spaces API in Flutter, I thought it would be a simple POST → GET workflow.

But turns out, the GET request is actually a stream, which means you have to:

Continuously listen to the data

Check if the full response has been received

Accumulate all chunks

Parse the final JSON

That’s a lot of moving parts—especially in Dart where this pattern isn’t as straightforward as in Python or JavaScript.

So, I built hugging_face_chat_gradio :package:

A package that handles all of this for you:

:white_check_mark: Just send a message, get a response

:white_check_mark: No need to worry about streaming, parsing, or JSON handling

:white_check_mark: Fully documented for easy use

If you’re working with Hugging Face Spaces in Flutter, check it out!

2 Likes

Great contribution to the community, Flutter is a framework with a lot of potential, thank you!

Best regards,
Adrian Araya, RidgeRun.ai

1 Like